<template>
  <div class="box">
    <div class="top">
      <span class="myNowAdress"
            @click="successTip">我的当前自提店</span>
      <span @click="changeMineAddress">切换自提店</span>
      <span class="triangle"></span>
    </div>
    <div class="bottom">
      <p class="station oneLine">{{this.$store.state.mineAddress.address}} - 附近菜鸟驿站</p>
      <p class="stationDetail oneLine">门店地址：<span>{{this.$store.state.mineAddress.address}}</span></p>
      <div class="twoBtn">
        <van-button plain
                    type="danger"
                    @click="callPhone">电话联系门店</van-button>
        <van-button plain
                    @click="errorTip('导航功能')">导航去门店</van-button>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: 'MyAddress',
  methods: {
    successTip() {
      this.$toast.success('高新区方大科技园菜鸟驿站')
    },
    errorTip(text) {
      this.$toast.error(`暂不支持${text}`)
    },
    callPhone() {
      window.location.href = 'tel://12315'
    },
    changeMineAddress() {
      this.$router.push('/mineAddress')
    }
  }
}
</script>

<style lang='less' scoped>
.box {
  margin-bottom: 25px;
  background-color: white;
}
.top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 0 25px;
  height: 40px;
  background-color: rgba(255, 206, 8, 0.3);
  border-bottom: 1px solid #f0f0f0;
}
.myNowAdress {
  color: rgb(162, 136, 28);
  font-weight: 600;
}
.triangle {
  position: absolute;
  left: 49%;
  bottom: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid rgba(255, 206, 8, 0.5);
  border-right: 10px solid transparent;
  border-left: 10px solid transparent;
}
.bottom {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding-left: 18px;
  height: 150px;
  position: relative !important;
}
.twoBtn {
  display: flex;
  justify-content: space-between;
  padding-right: 18px;
}
.station {
  font-weight: 600;
}
.stationDetail span {
  font-size: 14px;
}
.van-button--danger,
.van-button--default {
  border-width: 1.5px;
}
.van-button--default {
  color: #5a5a5c;
  border-color: #767676;
}
</style>